package org.binge.widget.facade;

import java.util.List;
import java.util.Map;

/**
 * Created by Kid on 2016/5/8.
 */
public interface BpFileService {


    /**
     * 入库文件file和data:Bp_File  Bp_Data表
     *
     * @param fileMap 文件入库附属信息
     * @return
     * @throws Exception
     */
    public int insertFileAndData(Map fileMap) throws Exception;

    /**
     * 入库文件行和列:Bp_Data_line  Bp_Data_Col表
     *
     * @param resultList    入库行list;
     * @param fileMap       入库文件附属信息;
     * @param lineAndColMap 分段入库某一段的入库过程信息
     * @return 分段入库某一段的入库过程信息
     * @throws Exception
     */
    public Map<String, Long> insertLineAndCol(List<List<Object>> resultList, Map fileMap, Map<String, Long> lineAndColMap) throws Exception;

    //col line入库成功后,更新file data 表
    public long updateFileAndData(Map fileMap, Map<String, Long> lineAndColMap) throws Exception;

    //获取保存文件列表(分页)
    public Map selectBpFilesPager(String startDate, String endDate, Integer start, Integer rows) throws Exception;

    //查询插入数据成功条数(根据fileId)
    public int selectSuccessCount(Long fileId) throws Exception;

    //查询文件内容信息（分页）(获得所有数据，不带标题)
    public List selectBpFileAndDataPager(Integer start, Integer rows, Long fileId) throws Exception;

    //获取文件第一行标题内容
    public List getInitHead(Long fileId) throws Exception;


    //根据fileId templateCode分段获得匹配数据
    public List<Map<String, String>> getTableDataPager(int start, int end, long fileId, String templateCode) throws Exception;

    //根据templateCode获取模板服务字符串
    public Map<String, String> getBpTemplateToMap(String templateCode) throws Exception;


}
